<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="js/jquery-3.6.0.min.js"></script>
<style>
#mydiv{
	width: 920px;
	margin: 10 auto;
}
.p{
	width: 100px;
	margin: 0 5px;
	text-align: center;
	float: left;
}

</style>
		<script>
		$(function(){
				$.ajax({
					// url:"http://10.64.149.28:8080/temo/login",
				url:"http://10.64.149.29:8080/temo/ProductServlet?method=showAll&currentPage=2",
				method:"post",
				//data:{"method":"login","c_name":name,"c_pass":pwd},
				dataType:"json",
				success:function(result){
					console.log(result.list);
					$(result.list).each(function(index,value){
						var html= `	<div class="p">
				<img src="http://10.64.149.29:8080/temo/`+value.p_image+`" style="width:80px;height:80px">
				<span>`+value.p_name+`</span>
				<span>`+value.p_price+`</span>
				<button>加入到购物车</button>
			</div>`;
						$("#mydiv").append(html);
					})
		}
	});
});
		</script>
</head>
<body>
	<div id="mydiv">
		
		
	</div>
</body>
</html>
